<h2><%= @movie.title %></h2>

<p>
  Released on <%= @movie.release_date %>. Rated <%= @movie.rating %>.<br/>
</p>

<%= simple_format(@movie.description) %>

<ul id="page_nav">
  <% if logged_in? %>
  <li>
    <%= link_to "Edit", edit_movie_path(@movie) %>
    or
    <%= link_to "Delete", movies_path, :confirm => "Delete #{@movie.title}?", :method => :delete %>
    <em><%= @movie.title %></em>.
  </li>
  <% end %>
  <li>Return to <%= link_to "Movies", movies_path %></li>
</ul>

<h3>Reviews</h3>
<% if @count.present? %>
  <p>
    Average rating based on <%= @count %> scores: <%= @average %>
  </p>
  <ul>
    <%= render :partial => "reviews/review", :collection => @movie.reviews %>
  </ul>
<% else %>
  <p>This movie has not been reviewed yet.</p>
<% end %>

<% if logged_in? and @review.new_record? %>
  <%= render :partial => "reviews/edit" %>
<% end %>
